package com.fmx.BookStore.service;

import com.fmx.BookStore.domain.Book;
import com.fmx.BookStore.domain.Sale;

import java.math.BigDecimal;

public interface ISaleService {
    /**
     * 开始新的销售
     */
    Sale makeNewSale();

    /**
     * 实例化SaleItem
     * @param book 商品对象
     * @param quantity 数量
     */
    void makeLineItem(Book book, int quantity);

    /**
     * 结束订单商品录入
     * @return 总金额
     */
    BigDecimal endSale();

    /**
     * 订单支付
     * @param cashTendered 付款金额
     * @return 找零
     */
    BigDecimal makePayment(BigDecimal cashTendered);

    /**
     * 删除商品明细
     */
    void deleteSaleItem(Long bookId);

    void changeNum(Long bookId, int quantity);
}
